﻿Public Class StandardArgsHandler
    Implements IArgsTypeHandler

    Public ReadOnly Property DefaultTypeData As String Implements IArgsTypeHandler.DefaultTypeData
        Get
            Return ""
        End Get
    End Property

    Public ReadOnly Property TypeDataFormat As String Implements IArgsTypeHandler.TypeDataFormat
        Get
            Return ""
        End Get
    End Property

    Public Function ValidateTypeData(typeData As String) As Boolean Implements IArgsTypeHandler.ValidateTypeData
        Return True
    End Function

    Public Function GetArgument(argumentIndex As Integer, usage As TokenUsage) As ArgumentDefinition Implements IArgsTypeHandler.GetArgument
        If argumentIndex < usage.Arguments.Count Then
            Return usage.Arguments(argumentIndex)
        Else
            Dim def As New ArgumentDefinition
            def.Description = ""
            def.Index = argumentIndex
            def.Type = ArgType.String
            def.Name = String.Format("[Unknown {0}]", argumentIndex - usage.Arguments.Count + 1)
            Return def
        End If

    End Function

    Public ReadOnly Property HasDynamicArguments As Boolean Implements IArgsTypeHandler.HasDynamicArguments
        Get
            Return False
        End Get
    End Property

    'Public Function GetArgumentName(argumentIndex As Integer, usage As TokenUsage) As String Implements IArgsTypeHandler.GetArgumentName
    '    If usage.Arguments.Count > argumentIndex Then
    '        Return usage.Arguments(argumentIndex).Name
    '    Else
    '        Return String.Format("[argument {0}]", argumentIndex + 1)
    '    End If
    'End Function
End Class
